package com.shhic.hhplt.server.model;

import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class SerialCode {
	private String codeName;	//编码名称，格式 代号[@场景]，其中场景可选，如mac@重庆产线
	private String description;
	private String scheme;
	private String nowCode;
	private int isCycle;
	private int isAvailable;	//是否可用
	private Queue<String> retrievedCodeList = new LinkedList<String>();
	public String getScheme() {
		return scheme;
	}
	public void setScheme(String scheme) {
		this.scheme = scheme;
	}
	public String getNowCode() {
		return nowCode;
	}
	public void setNowCode(String nowCode) {
		this.nowCode = nowCode;
	}
	public Queue<String> getRetrievedCodeList() {
		return retrievedCodeList;
	}
	public void setRetrievedCodeList(List<String> retrievedCodeList) {
		this.retrievedCodeList.clear();
		this.retrievedCodeList.addAll(retrievedCodeList);
	}
	public String getCodeName() {
		return codeName;
	}
	public void setCodeName(String codeName) {
		this.codeName = codeName;
	}
	
	public String getCodeNameTitle(){
		//由codeName，截取代号部分
		if(!codeName.contains("@")){
			return codeName;
		}else{
			return codeName.split("@")[0];
		}
	}
	
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public int getIsCycle() {
		return isCycle;
	}
	public void setIsCycle(int isCycle) {
		this.isCycle = isCycle;
	}
	public int getIsAvailable() {
		return isAvailable;
	}
	
	public boolean isAvailable(){
		return isAvailable != 0;
	}
	
	public void setIsAvailable(int isAvailable) {
		this.isAvailable = isAvailable;
	}
	
}
